package com.beiyan.mvc.repository.person;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.beiyan.mvc.model.test.Person;

public interface PersonRepository extends JpaRepository<Person, Long> {
	List<Person> findByUsername(String username);

	List<Person> findByUsernameLikeAndPassword(String username, String password);

	@Query(value = "select p from Person p where p.username like:name")
	List<Person> findPersonByNameLike(@Param("name") String username);

	// nativesql
	// @Query(value = "xxxx", nativeQuery = true)
	// List<Person> findPersonByNameLike2(@Param("name") String username);

}
